# Contributor: Jake Buchholz Göktürk <tomalok@gmail.com>
# Maintainer: Jake Buchholz Göktürk <tomalok@gmail.com>
pkgname=go-md2man
pkgver=2.0.2
pkgrel=1
pkgdesc="Utility to convert markdown to man pages"
options="net"
url="https://github.com/cpuguy83/go-md2man"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cpuguy83/go-md2man/archive/v$pkgver.tar.gz"

export GOPATH="$srcdir/go"
export GOCACHE="$srcdir/go-build"
export GOTMPDIR="$srcdir/"

export GOFLAGS="$GOFLAGS -modcacherw"

build() {
	go build

	./go-md2man -in go-md2man.1.md -out go-md2man.1
}

check() {
	grep -q "User Manual" go-md2man.1
}

package() {
	install -Dsm755 go-md2man "$pkgdir"/usr/bin/go-md2man
	install -Dm644 go-md2man.1 "$pkgdir"/usr/share/man/man1/go-md2man.1
}

sha512sums="
c81edfdc0b6647ef699cc908a1a7038d98da34df6d48b223b83a0699de91a7e322e70d67645acf1fc848918f4c1ea310160c7ccb75e6f97b53af7103c7aa18b3  go-md2man-2.0.2.tar.gz
"
